//
// Created by z00850016 on 2025/8/12.
//

#ifndef LOCALVIT_COMMON_H
#define LOCALVIT_COMMON_H


#include <android/log.h>

#define LOG_TAG "VISONLM"
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)

namespace localvit {
    enum ModelStatus {
        MODEL_STATUS_ERROR = -1,
        MODEL_STATUS_SUCCESS = 0
    };

    struct VisonBufferSize {
        uint32_t num;
        uint32_t channel;
        uint32_t width;
        uint32_t height;

        VisonBufferSize() {}

        VisonBufferSize(uint32_t num, uint32_t channel, uint32_t width, uint32_t height) :
                num(num), channel(channel), width(width), height(height) {}

        uint32_t getTotalSize() {
            return (num * channel * width * height);
        }
    };

    enum class VisionBufferDataType {
        UNKNOWN,
        FLOAT32,
        UINT8,
        INT32,
        INT64
    };

    struct VisionBuffer {
        void *buffer;
        VisonBufferSize bufferSize;
        bool isZeroCopy;
        VisionBufferDataType dataType;

        VisionBuffer() {}

        VisionBuffer(void *buffer, const VisonBufferSize &bufferSize, bool isZeroCopy) :
                buffer(buffer),
                bufferSize(bufferSize),
                isZeroCopy(isZeroCopy) {}
    };

}


#endif //LOCALVIT_COMMON_H
